import socket

socket_client = socket.socket()
socket_client.connect(("localhost", 8888))

while True:

    msg = input("请输入给服务端发送的消息：")
    if msg == 'exit':
        break
    socket_client.send(msg.encode("UTF-8"))
    recv_date = socket_client.recv(1024)
    print(f"服务器回复的消息是{recv_date.decode('UTF-8')}")
socket_client.close()
